
import i18n from "@/lang/index";

export function deleteTip() {
    return ElMessageBox.confirm(
			i18n.global.t('common.deleteConfirm'),
			i18n.global.t('common.Warning'),
			{
				confirmButtonText: i18n.global.t('common.confirm'),
				cancelButtonText: i18n.global.t('common.cancel'),
				type: 'warning',
			}
	);
}

export function confirmTip(message){
	return ElMessageBox.confirm(
			message,
			i18n.global.t('common.Warning'),
			{
				confirmButtonText: i18n.global.t('common.confirm'),
				cancelButtonText: i18n.global.t('common.cancel'),
				type: 'warning',
			}
	);
}

export function showToastApi(res){
	if (res.status==200){		
		ElMessage({
		  type: 'success',
		  message: res.data.result.message,
		})
	}else{
		ElMessage({
		  type: 'error',
		  message: res.message,
		})
	}
}

export function showToast(message, type){
	if (!type){
		type="error";
	}
	ElMessage({
		type: type,
		message: message,
	})
}

export function showSuccess(message){
	ElMessage({
		type: 'success',
		message: message,
	})
}
